* Clean up
clear all

/* Set working directory: please set your own
cd "~/Dropbox/JOP third submission/JOP replication/"
*/

* Open dataset

use 01_data/cis_data.dta, clear

* Local with outcomes
local outcomes had_doubts voted_conviction vote_decision_long_ago vote_loyalty 

* Loop over these outcomes and run regressions
foreach outcome in `outcomes'{
	regr `outcome' pp_dummy female i.income age age_sq i.education i.TAMUNI i.CCAA, r
	est store wp_`outcome'
}

* Make table
esttab wp_had_doubts wp_voted_conviction wp_vote_decision_long_ago wp_vote_loyalty using 03_tables/tablee2.tex, tex se replace  keep (pp_dummy) coeflabels (pp_dummy "PP voter") star(* 0.10 ** 0.05 *** 0.01) mtitles("Doubted vote choice" "Voted with conviction" "Decided vote long ago" "Loyal voter") addnotes("Standard errors are robust" "All models include region fixed effects" "All models include controls for income, education, age, age squared, size" " of respondent's municipality, and a dummy for respondents identifying as female")
